package com.itheima.lambda.practice02;

public class AddableDemo {
    public static void main(String[] args) {
        useAddable(new Addable() {
            @Override
            public int add(int a, int b) {
                return a+b;
            }
        });
        useAddable((int a, int b)->{
            return a+b;
        });
    }
    public static  void useAddable(Addable addable){
        System.out.println(addable.add(10, 20));
    }
}
interface Addable{
    int add(int a,int b);
}